package com.lvt.design.pattern.create.single.demo05;

import java.util.concurrent.atomic.AtomicLong;

/**
 * desc：class
 * 枚举
 *
 * @author LT
 * @date 2022/11/30
 */
public enum IdGenerator {
    /**
     * 实例
     */
    INSTANCE;

    private AtomicLong id = new AtomicLong(0);

    public long getId() {
        return id.incrementAndGet();
    }
}
